package builder;

import java.util.Vector;

import model.Action;

public class InterpreterBuilder extends AbstractPatternBuilder {

	private String client = "Client";
	private String context = "Context";
	private String abstractExpression = "AbstractExpression";
	private String terminalExpression = "TerminalExpression";
	private String nonTerminalExpression = "NonTerminalExpression";
	
	public InterpreterBuilder() {
		super();
	}

	@Override
	public Vector<Action> buildPattern() {
		
		this.buildClass(client);
		this.buildClass(context);
		this.buildClass(terminalExpression);
		this.buildClass(nonTerminalExpression);
		
		this.buildAbstractClass(abstractExpression);
		
		this.buildGeneralization(terminalExpression, abstractExpression);
		this.buildGeneralization(nonTerminalExpression, abstractExpression);
		
		this.buildAssociation(client, context);
		this.buildAssociation(client, abstractExpression);
		
		this.buildAggregation(abstractExpression,nonTerminalExpression);
		
		return patternActions;
	}

	@Override
	public void changeNames() {

		client = names.get(0);
		context = names.get(1);
		abstractExpression = names.get(2);
		terminalExpression = names.get(3);
		nonTerminalExpression = names.get(4);
		
	}
	
	@Override
	public int cantUMLElements() {
		return 5;
	}

}
